;:sys36864
	;.opt oo
	*= $c000
bsout	=$ffd2
open	=$ffc0
close	=$ffc3
clrchn	=$ffcc
chkin	=$ffc6
get	=$ffe4
tmp	=2
striout	=$ab1e
cr	=13
cint	=65409
vic	=$d000
prganf	=43
mem	=247
talk	=$ffb4
sectalk	=$ff96
untalk	=$ffab
sa	=$b9
fa	=$ba
iecin	=$ffa5
f	=8
key	=198
return	=$aad7
chrin	=$ffcf
setnam	=$ffbd
setpar	=$ffba
chkout	=$ffc9
space	=$ab3f
axout	=$bdcd
fline	=$cf80
sline	=$cf00
namlen	=$b7
facasc	=$bddf
intfloat	=$bc49
fac	=$62
buff	=$100
setay	=$bf0c
ioflg	=157
clall	=$ffe7
load	=$ffd5
	jmp anfang
titxt	.byte "\x1a\x93\x97\x8e\x08\xb0\x19&\xc0\xae\xdd\x12\x19\x0a line-verify  v 4.0\x19\x0a \x92\xdd"
	.byte "B\x12\x19\x04 von n. heusler\x19\x04 (c) nh 02.92\x19\x04 \x92\xdd"
	.byte "B\x12  zwengauerweg 18   8000 muenchen 71  \x92\xdd\xad\x19&\xc0\xbd\x03"
derr	.byte "\x1a\x1aachtung: \x03"
drbs	.byte "\x1a\x1aausgabe auf drucker?  (j/n) \x12\x03"
weh	.byte "\x1a\x1aprogrammname \x03"
sicher	.byte "\x1a\x1aeingaben ok?\x19\x0a (j/n) \x12\x03"
i0	.byte "i0"
prnt	.byte "\x1adruckvorgang laeuft\x1a\x03"
adrt	.byte "\x1a\x19\x06 (programm 1)\x19\x05 (programm 2)\x1aadr. : $\x03"
hexz	.byte "0123456789abcdef"
both	.byte "\x19\x06 beide programme beendet\x1a\x03"
mord	.byte "vorzeit. ende\x1a\x03"
richt	.byte "gleich\x1a\x03"
fehlt	.byte "fehlt\x1a\x03"
unglt	.byte "unterschied\x1a\x03"
ask3	.byte "\x1a\x1aprg. 1 schon geladen? (j/n) \x12\x03"
ask1	.byte "\x1a\x1astatistik ausgeben?   (j/n) \x12\x03"
ask2	.byte "\x1a\x1aident. zeilen melden? (j/n) \x12\x03"
stat1	.byte "\x1a\x1aanzahl getestete zeilen \x19\x05. \x03"
stat2	.byte "\x161 \x19\x04. \x03"
stat3	.byte "\x162 \x19\x04. \x03"
fau	.byte "\x1aanzahl zeilen programm \x03"
stat4	.byte "\x1agleiche zeilen \x19\x0e. \x03"
stat5	.byte "\x1aunterschiedl. zeilen \x19\x08. \x03"
stat6	.byte "\x1afehlende zeilen \x19\x0c.. \x03"
serr	.byte "\x1a\x19\x17 datei unlesbar\x1a\x1a\x03"
eld	.byte " byte unterschiedl.\x1a\x03"
outadr	brk
name1	.word 0,0,0,0,0,0,0,0
	brk
name2	.word 0,0,0,0,0,0,0,0
	brk
lae1	brk
mode	brk
ends	brk
merkx	brk
linef	.word 0
lines	.word 0
anz1	.word 0
anz2	.word 0
feanz	.word 0
zeanz	.word 0
glanz	.word 0
untanz	.word 0
endf	brk
stp	brk
delta	brk
lgf	brk
lgs	brk
strout	tax
	lda tmp
	pha
	lda tmp+1
	pha
	stx tmp
	sty tmp+1
stt	ldy #0
	lda (tmp),y
	beq eoi
	cmp #"\x03"
	beq eoi
	cmp #"\x1a"
	bne nocr
	lda #cr
nocr	cmp #"\x19"
	beq repeat
	cmp #"\x17"
	beq www
	cmp #"\x16"
	beq vvv
	jsr bsout
weiter	inc tmp
	bne stt
	inc tmp+1
	bne stt
eoi	pla
	sta tmp+1
	pla
	sta tmp
	rts
vvv	lda #<fau
	ldy #>fau
	jsr strout
	jmp weiter
repeat	iny
	lda (tmp),y
	tax
	iny
	lda (tmp),y
rpp	jsr bsout
	dex
	bne rpp
	lda tmp
	clc
	adc #3
	sta tmp
	lda tmp+1
	adc #0
	sta tmp+1
	bne stt
www	lda #<weh
	ldy #>weh
	jsr strout
	jmp weiter
title	lda #<titxt
	ldy #>titxt
	jmp strout
vicinit	jsr cint
	lda #15
	sta vic+33
	sta vic+32
	rts
cloall	jsr clrchn
	lda #0
	sta ioflg
	lda #1
	jsr close
	lda #2
	jsr close
	jmp clall
xstrout	pha
	txa
	jsr strout
	pla
	jsr bsout
	jsr $ab45
	jmp $ab3f
initf	lda #2
	ldx #<i0
	ldy #>i0
	jsr setnam
	ldx #f
	lda #15
	tay
	jsr setpar
	jsr open
	lda #15
	jsr close
status	lda #f
	sta fa
	jsr talk
	lda #$6f
	sta sa
	jsr sectalk
	jsr iecin
	cmp #"0"
	beq aechtz
	pha
	lda #<derr
	ldy #>derr
	jsr strout
	pla
	jsr bsout
errin	jsr iecin
	jsr bsout
	cmp #cr
	bne errin
	sec
	.byt $24
aechtz	clc
	php
	jsr untalk
	plp
	rts
clrnam	ldx #32
	txa
cnam	sta name1,x
	dex
	bpl cnam
rt	rts
vorber	lda #0
	sta namlen
	jsr title
	lda outadr
	cmp #4
	bne rt
	lda #<prnt
	ldy #>prnt
	jmp strout
hexout	pha
	lsr
	lsr
	lsr
	lsr
	jsr hx
	pla
hx	and #$f
	tax
	lda hexz,x
	jmp bsout
ougs	jsr outs
	ldx #7
xspace	jsr space
	dex
	bne xspace
	rts
getfline	jsr in
	jsr etfline
	jmp out
etfline	jsr get
	jsr get
	bne holl1
	lda #-1
	rts
holl1	jsr get
	sta linef
	jsr get
	sta linef+1
	ldx #0
	inc anz2
	bne holl
	inc anz2+1
holl	stx merkx
	jsr get
	ldx merkx
	sta fline,x
	tay
	beq eolf
	inx
	txa
	bpl holl
	jsr out
	lda #<serr
	ldy #>serr
	jsr strout
	lda #-1
	rts
eolf	stx lgf
	lda #0
	rts
eols	stx lgs
	lda #0
	rts
getsline	jsr gets
	jsr gets
	bne soll1
	lda #-1
	rts
soll1	jsr gets
	sta lines
	jsr gets
	sta lines+1
	ldx #0
	inc anz1
	bne soll
	inc anz1+1
soll	jsr gets
	sta sline,x
	beq eols
	inx
	bne soll
gets	ldy #0
	lda (mem),y
	pha
	inc mem
	bne nocy
	inc mem+1
nocy	pla
	rts
in	pha
	jsr clrchn
	ldx #2
	jsr chkin
	pla
	rts
out	pha
	jsr clrchn
	ldx #1
	jsr chkout
	pla
	rts
full	lda #"\xa6"
	ldx #5
fll	sta buff,x
	dex
	bpl fll
	rts
fuenfout	sta fac
	stx fac+1
	jsr full
	ldx #$90
	sec
	jsr intfloat
	jsr facasc
	ldx #5
	inc zeanz
	bne such0
	inc zeanz+1
such0	lda buff,x
	beq fnd
	dex
	bpl such0
fnd	cpx #5
	bcs filled
	ldy #5
schieb	lda buff,x
	sta buff,y
	dey
	dex
	bpl schieb
	lda #32
fill	sta buff,y
	dey
	bpl fill
filled	jsr setay
	jsr striout
	lda #":"
	jmp bsout
test	lda lines+1
	cmp linef+1
	bcc sklein
	bne sgross
	lda lines
	cmp linef
	bcc sklein
	bne sgross
	lda #0
	rts
sgross	lda #-1
	rts
sklein	lda #1
	rts
fehl	jsr xspace
	lda #<fehlt
	ldy #>fehlt
	jsr strout
incfe	inc feanz
	bne rtt
	inc feanz+1
rtt	rts
strout0	jsr strout
	sty key
	rts
getmode	ldy #1
	lda (prganf),y
	beq load1
	lda #<ask3
	ldy #>ask3
	jsr strout0
fray	jsr get
	tax
	cmp #"j"
	beq nixda2
	cmp #"n"
	bne fray
	jsr bsout
load1	lda lae1
	ldx #<name1
	ldy #>name1
	jsr setnam
	ldx #f
	lda #0
	jsr setpar
	ldx prganf
	ldy prganf+1
	jsr load
	jsr status
	bcc nixda
	jmp raus
nixda2	jsr bsout
nixda	lda #<ask1
	ldy #>ask1
	jsr strout0
wk3	jsr get
	tax
	cmp #"n"
	beq nein
	cmp #"j"
	bne wk3
	lda mode
	ora #2
	sta mode
nein	txa
	jsr bsout
	lda #<ask2
	ldy #>ask2
	jsr strout0
wk4	jsr get
	cmp #"n"
	beq ne
	cmp #"j"
	bne wk4
	inc mode
ne	jsr bsout
	lda #<drbs
	ldy #>drbs
	jsr strout0
wk	jsr get
	cmp #"n"
	beq bs
	cmp #"j"
	bne wk
	ldx #4
	.byt $2c
bs	ldx #3
	stx outadr
	.byt $2c
more	lda #"<"
	jmp bsout
clrvar	ldx #11
	lda #0
	sta mode
cvar	sta anz1,x
	dex
	bpl cvar
	rts
anfang	tsx
	stx stp
	jsr cloall
	jsr vicinit
	jsr title
	jsr clrnam
	jsr initf
	bcc oky
raus	ldx stp
	txs
	rts
oky	ldx #<weh
	ldy #>weh
	lda #"1"
	jsr xstrout
	jsr clrvar
	tax
get1	jsr chrin
	cmp #cr
	beq cer1
	sta name1,x
	inx
	cpx #16
	bcc get1
cer1	stx lae1
	ldx #<weh
	ldy #>weh
	lda #"2"
	jsr xstrout
	ldx #0
get2	jsr chrin
	cmp #cr
	beq cer2
	sta name2,x
	inx
	cpx #16
	bcc get2
cer2	txa
	pha
	jsr getmode
	pla
	ldx #<name2
	ldy #>name2
	jsr setnam
	lda #<sicher
	ldy #>sicher
	jsr strout
	sty key
wk2	jsr get
	cmp #"n"
	bne nofalsch
	jmp anfang
nofalsch	cmp #"j"
	bne wk2
	jsr bsout
	ldx #f
	lda #2
	tay
	jsr setpar
	jsr open
	jsr status
	bcs raus
	jsr vorber
	ldx outadr
	lda #1
	ldy #0
	jsr setpar
	jsr open
	jsr out
	jsr return
	ldx #6
	jsr xspace
	lda #<name1
	ldy #>name1
	jsr strout
	lda #<adrt
	ldy #>adrt
	jsr strout
	lda prganf+1
	sta mem+1
	jsr hexout
	lda prganf
	sta mem
	jsr hexout
	ldx #12
	jsr xspace
	lda #"$"
	jsr bsout
	jsr in
	jsr get
	pha
	jsr get
	jsr out
	jsr hexout
	pla
	jsr hexout
	jsr return
	ldx #39
	lda #"-"
strich	jsr bsout
	dex
	bne strich
	jsr return
zeile	jsr $a82c
	jsr getsline
	sta ends
	jsr getfline
	sta endf
	cmp ends
	bne ungleich
	tax
	beq nofin
	inc endf
	inc ends
	lda #<both
	ldy #>both
	jsr strout
ende	jsr statis
	jsr return
	jmp cloall
ungleich	tax
	beq memend
flopend	ldx #23
	.byt $2c
memend	ldx #6
	jsr xspace
	lda #<mord
	ldy #>mord
	jsr strout
	jmp ende
nofin	jsr test
	beq gleich
	bpl schnells
	ldx linef
	lda linef+1
	jsr fuenfout
	lda #<fehlt
	ldy #>fehlt
	jsr strout
	jsr incfe
	jsr getfline
	bne flopend
	beq nofin
schnells	jsr outs
	ldx #17
	jsr fehl
	jsr getsline
	bne memend
	beq nofin
gleich	lda lgs
	cmp lgf
	bne anders
	ldx #0
	stx delta
	dex
comp	inx
	lda sline,x
	cmp fline,x
	beq preis
	inc delta
preis	tay
	bne comp
	lda delta
	bne other
	inc glanz
	bne nocarry
	inc glanz+1
nocarry	lda mode
	and #1
	beq qzeile
	jsr ougs
	lda #<richt
	ldy #>richt
sag	jsr strout
	jmp zeile
other	lda delta
	cmp #10
	bcs anders
	inc untanz
	bne n
	inc untanz+1
n	jsr ougs
	ldx delta
	lda #0
	jsr axout
	lda #<eld
	ldy #>eld
	bne sag
anders	inc untanz
	bne nocry
	inc untanz+1
nocry	jsr ougs
	lda #<unglt
	ldy #>unglt
	bne sag
outs	ldx lines
	lda 1+lines
	jmp fuenfout
qzeile	inc zeanz
	bne qq
	inc zeanz+1
qq	jmp zeile
statis	lda mode
	and #2
	beq hopp
	lda #<stat1
	ldy #>stat1
	jsr strout
	ldx zeanz
	lda zeanz+1
	jsr axout
	lda #<stat2
	ldy #>stat2
	jsr strout
	ldx anz1
	lda anz1+1
	jsr axout
	lda endf
	beq j1
	jsr more
j1	lda #<stat3
	ldy #>stat3
	jsr strout
	ldx anz2
	lda anz2+1
	jsr axout
	lda ends
	beq j2
	jsr more
j2	lda #<stat4
	ldy #>stat4
	jsr strout
	ldx glanz
	lda glanz+1
	jsr axout
	lda #<stat5
	ldy #>stat5
	jsr strout
	ldx untanz
	lda untanz+1
	jsr axout
	lda #<stat6
	ldy #>stat6
	jsr strout
	ldx feanz
	lda feanz+1
	jsr axout
hopp	lda #0
	sta key
	rts
